home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume21 / amd / part02 < prev    next >
Encoding:
Internet Message Format  |  1990-04-10  |  57.0 KB

  1. Subject:  v21i090:  An Automounter for NFS systems, Part02/13
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4. X-Checksum-Snefru: 8601f2cd 8e46789d d279f720 f20dc7e4
  5.  
  6. Submitted-by: Jan-Simon Pendry <jsp@doc.ic.ac.uk>
  7. Posting-number: Volume 21, Issue 90
  8. Archive-name: amd/part02
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then unpack
  12. # it by saving it into a file and typing "sh file".  To overwrite existing
  13. # files, type "sh file -c".  You can also feed this as standard input via
  14. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  15. # will see the following message at the end:
  16. #        "End of archive 2 (of 13)."
  17. # Contents:  Makefile Makefile.config a_master amq-man amq_svc.c
  18. #   efs_ops.c fs.h hpux.h info_hes.c info_yp.c os-aux.h os-defaults.h
  19. #   os-hpux.h os-type os-xinu43.h sfs_ops.c umount_fs.c uwait.h
  20. # Wrapped by rsalz@papaya.bbn.com on Tue Apr 10 15:11:59 1990
  21. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  22. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  23.   echo shar: Will not clobber existing file \"'Makefile'\"
  24. else
  25. echo shar: Extracting \"'Makefile'\" \(2901 characters\)
  26. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  27. X#
  28. X# $Id: Makefile,v 5.1.1.2 90/01/11 16:46:02 jsp Exp Locker: jsp $
  29. X#
  30. X# Copyright (c) 1989 Jan-Simon Pendry
  31. X# Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  32. X# Copyright (c) 1989 The Regents of the University of California.
  33. X# All rights reserved.
  34. X#
  35. X# This code is derived from software contributed to Berkeley by
  36. X# Jan-Simon Pendry at Imperial College, London.
  37. X#
  38. X# Redistribution and use in source and binary forms are permitted
  39. X# provided that the above copyright notice and this paragraph are
  40. X# duplicated in all such forms and that any documentation,
  41. X# advertising materials, and other materials related to such
  42. X# distribution and use acknowledge that the software was developed
  43. X# by Imperial College of Science, Technology and Medicine, London, UK.
  44. X# The names of the College and University may not be used to endorse
  45. X# or promote products derived from this software without specific
  46. X# prior written permission.
  47. X# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  48. X# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  49. X# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  50. X#
  51. X#    %W% (Berkeley) %G%
  52. X#
  53. X
  54. X# -------- Users may care to over ride these values --------
  55. XVER = ${REL}
  56. XSHELL = /bin/sh
  57. X
  58. X# Machine architecture
  59. XARCH = `PATH=$${PATH}:. sh arch`
  60. X
  61. X# O/S Name
  62. XOS = `PATH=$${PATH}:. sh os-type`
  63. X
  64. X# version of make
  65. XMAKE = make
  66. XMKCOM = Makefile.com
  67. XMKARGS = -f ${MKCOM}
  68. X
  69. X# -------- Users should leave the rest alone! --------
  70. X
  71. XOS_SUPPORTED = acis43 aix2 aux bsd44 concentrix hlh42 hpux riscix sos3 sos4 u2_2 u3_0 umax43 utx32 xinu43
  72. XCHECK_OS = \
  73. X    case " ${OS_SUPPORTED} " in *" $${OS} "*) ;; \
  74. X    *) case "$${OS}" in unknown);; *) echo "Unknown OS '$${OS}'";; esac; \
  75. X       echo "OS should be one of ${OS_SUPPORTED}"; \
  76. X       exit 1;; \
  77. X    esac
  78. X
  79. X#
  80. X# "all" and "install" work in the architecture specific sub-directory.
  81. X# The other make rules work in the source directory.
  82. X#
  83. X
  84. Xall install clean lint:
  85. X    @OS="${OS}" ARCH="${ARCH}" MKARGS="-f ../${MKCOM}"; \
  86. X    ${CHECK_OS}; \
  87. X    case "`echo M?kefile.config`" in \
  88. X    Makefile.config) MKARGS="$${MKARGS} -f ../Makefile.config";; \
  89. X    esac; \
  90. X    case "`echo M?kefile.$${OS}`" in \
  91. X    Makefile.$${OS}) MKARGS="$${MKARGS} -f ../Makefile.$${OS}";; \
  92. X    esac; \
  93. X    case "`echo M?kefile.local`" in \
  94. X    Makefile.local) MKARGS="$${MKARGS} -f ../Makefile.local";; \
  95. X    esac; \
  96. X    case "`echo M?kefile.local.$${OS}`" in \
  97. X    Makefile.local.$${OS}) MKARGS="$${MKARGS} -f ../Makefile.local.$${OS}";; \
  98. X    esac; \
  99. X    case "`echo $${ARCH}?$${OS}`" in $${ARCH}_$${OS});; *) mkdir $${ARCH}_$${OS}; esac; \
  100. X    echo cd $${ARCH}_$${OS}; \
  101. X    cd $${ARCH}_$${OS}; \
  102. X    echo $(MAKE) $${MKARGS} ARCH=$${ARCH} OS=$${OS} $@; \
  103. X    $(MAKE) $${MKARGS} ARCH=$${ARCH} OS=$${OS} $@
  104. X
  105. Xco diffs release count: FRC
  106. X    $(MAKE) ${MKARGS} ${MFLAGS} $@ OS=undef NAME=${NAME} REL=${REL} "VER=${VER}"
  107. X
  108. Xpat print tarfile sharfile: FRC
  109. X    @$(MAKE) ${MKARGS} ${MFLAGS} $@ OS=undef
  110. X
  111. XFRC:
  112. END_OF_FILE
  113. if test 2901 -ne `wc -c <'Makefile'`; then
  114.     echo shar: \"'Makefile'\" unpacked with wrong size!
  115. fi
  116. # end of 'Makefile'
  117. fi
  118. if test -f 'Makefile.config' -a "${1}" != "-c" ; then 
  119.   echo shar: Will not clobber existing file \"'Makefile.config'\"
  120. else
  121. echo shar: Extracting \"'Makefile.config'\" \(2576 characters\)
  122. sed "s/^X//" >'Makefile.config' <<'END_OF_FILE'
  123. X#
  124. X# $Id: Makefile.config,v 5.1.1.2 90/01/11 16:48:18 jsp Exp Locker: jsp $
  125. X#
  126. X# Copyright (c) 1990 Jan-Simon Pendry
  127. X# Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  128. X# Copyright (c) 1990 The Regents of the University of California.
  129. X# All rights reserved.
  130. X#
  131. X# This code is derived from software contributed to Berkeley by
  132. X# Jan-Simon Pendry at Imperial College, London.
  133. X#
  134. X# Redistribution and use in source and binary forms are permitted
  135. X# provided that the above copyright notice and this paragraph are
  136. X# duplicated in all such forms and that any documentation,
  137. X# advertising materials, and other materials related to such
  138. X# distribution and use acknowledge that the software was developed
  139. X# by Imperial College of Science, Technology and Medicine, London, UK.
  140. X# The names of the College and University may not be used to endorse
  141. X# or promote products derived from this software without specific
  142. X# prior written permission.
  143. X# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  144. X# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  145. X# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  146. X#
  147. X#    %W% (Berkeley) %G%
  148. X#
  149. X
  150. X#
  151. X# Comment/uncomment the following lines as required
  152. X#
  153. X
  154. X#
  155. X# Where local include files are stored
  156. X#
  157. X#XINCLUDE = -I/usr/local/athena/include
  158. X
  159. X#
  160. X# Define RESOLV if your C library does not include support
  161. X# for Hesiod and/or Named.
  162. X#
  163. X#RESOLV = -lhesiod -lresolv
  164. X
  165. X#
  166. X# Define XLIBDIR if you have libraries not on the standard
  167. X# search path.
  168. X#
  169. X#XLIBDIR = -L/usr/local/athena/lib
  170. X
  171. X#
  172. X# Define DBM if your C library does not include
  173. X# support for gdbm and/or ndbm.
  174. X#
  175. X#DBM = -lgdbm #-lndbm
  176. X
  177. X#
  178. X# Define RPCLIB if your C library does not include
  179. X# support for RPC
  180. X#
  181. X#RPCLIB = -lrpc
  182. X
  183. X#
  184. X# Include support for Yellow Pages
  185. X#
  186. XHAS_YP_MAPS = -DHAS_YP_MAPS
  187. X
  188. X#
  189. X# Include support for file maps
  190. X#
  191. XHAS_FILE_MAPS = -DHAS_FILE_MAPS
  192. X
  193. X#
  194. X# Include support for Hesiod
  195. X#
  196. X#HAS_HESIOD_MAPS = -DHAS_HESIOD_MAPS
  197. X
  198. X#
  199. X# Include support for mountd
  200. X# Not released - design not complete...
  201. X#
  202. X#HAS_MOUNTD_MAPS = -DHAS_MOUNTD_MAPS
  203. X
  204. X#
  205. X# Include support for ndbm.
  206. X# This removes support for gdbm and is only supported
  207. X# if your operating system supports ndbm
  208. X#
  209. X#HAS_NDBM_MAPS = -DHAS_NDBM_MAPS
  210. X
  211. X#
  212. X# Include support for gdbm.
  213. X# This removes support for ndbm if your system supports it
  214. X#
  215. X#HAS_GDBM_MAPS = -DHAS_GDBM_MAPS
  216. X
  217. X
  218. X##############################################################
  219. X# Do NOT edit the following lines
  220. X#
  221. XCONFIG = ${XINCLUDE} ${HAS_YP_MAPS} ${HAS_FILE_MAPS} ${HAS_HESIOD_MAPS} \
  222. X        ${HAS_NDBM_MAPS} ${HAS_GDBM_MAPS} ${HAS_MOUNTD_MAPS}
  223. END_OF_FILE
  224. if test 2576 -ne `wc -c <'Makefile.config'`; then
  225.     echo shar: \"'Makefile.config'\" unpacked with wrong size!
  226. fi
  227. # end of 'Makefile.config'
  228. fi
  229. if test -f 'a_master' -a "${1}" != "-c" ; then 
  230.   echo shar: Will not clobber existing file \"'a_master'\"
  231. else
  232. echo shar: Extracting \"'a_master'\" \(2535 characters\)
  233. sed "s/^X//" >'a_master' <<'END_OF_FILE'
  234. X#machine    opts info
  235. Xachilles    -opts:=rw,grpid,nosuid \
  236. X        type:=ufs;hostd==achilles.doc;dev:=/dev/xy1g \
  237. X        type:=nfs;hostd!=achilles.doc;rhost:=achilles.doc;rfs:=/home/achilles
  238. X#
  239. Xdougal        -opts:=rw,grpid,nosuid \
  240. X        type:=ufs;hostd==dougal.doc;dev:=/dev/dsk/1s0 \
  241. X        type:=nfs;hostd!=dougal.doc;rhost:=dougal.doc;rfs:=/home/dougal
  242. X#
  243. Xdylan        type:=auto;fs:=${map};pref:=${key}/
  244. Xdylan/dk2    -opts:=rw,grpid,nosuid \
  245. X        hostd==dylan.doc;type:=ufs;dev:=/dev/dsk/2s0 \
  246. X        hostd!=dylan.doc;type:=nfs;rhost:=dylan.doc;rfs:=/home/dylan/dk2
  247. X#
  248. Xdylan/dk3    -opts:=rw,grpid,nosuid \
  249. X        hostd==dylan.doc;type:=ufs;dev:=/dev/dsk/3s0 \
  250. X        hostd!=dylan.doc;type:=nfs;rhost:=dylan.doc;rfs:=/home/dylan/dk3
  251. X#
  252. Xdylan/dk5    -opts:=rw,grpid,nosuid \
  253. X        hostd==dylan.doc;type:=ufs;dev:=/dev/dsk/5s0 \
  254. X        hostd!=dylan.doc;type:=nfs;rhost:=dylan.doc;rfs:=/home/dylan/dk5
  255. X#
  256. Xganymede    -opts:=rw,grpid,nosuid \
  257. X        hostd!=${key}.${domain};type:=nfs;rhost:=${key}.${domain};rfs:=/home/${key}
  258. Xgummo        -opts:=rw,grpid,nosuid \
  259. X        hostd!=gummo.doc;type:=nfs;rhost:=gummo.doc;rfs:=/home/gummo
  260. X#
  261. X# Wildcard match
  262. X*        -opts:=rw,grpid,nosuid \
  263. X        hostd!=${key}.${domain};type:=nfs;rhost:=${key}.${domain};rfs:=/home/${key}
  264. X#
  265. X#
  266. Xgould        -opts:=rw,grpid,nosuid \
  267. X        hostd!=gould.doc;type:=nfs;rhost:=gould.doc;rfs:=/home/gould
  268. Xtoytown        -opts:=rw,grpid,nosuid \
  269. X        hostd!=toytown.doc;type:=nfs;rhost:=toytown.doc;rfs:=/home/${key}
  270. Xzebedee        -opts:=rw,grpid,nosuid \
  271. X        hostd!=zebedee.doc;type:=nfs;rhost:=zebedee.doc;rfs:=/home/zebedee
  272. X#
  273. X# Should be ENOENT from mountd on toytown...
  274. X#
  275. Xtesting        -opts:=rw,grpid,nosuid \
  276. X        hostd!=toytown.doc;type:=nfs;rhost:=toytown.doc;rfs:=/this/that
  277. X#
  278. X# Somewhere else
  279. X#
  280. Xpebbles        -opts:=rw,grpid,nosuid \
  281. X        hostd!=pebbles.cc;type:=nfs;rhost:=pebbles.cc;rfs:=/home/cc/pebbles
  282. X#
  283. X# Specify where to mount
  284. X#
  285. Xxtoy        -opts:=rw,grpid,nosuid \
  286. X        type:=nfs;rhost:=toytown.doc;rfs:=/home/toytown;fs:=/tmp/junk99
  287. X#
  288. X# Links...
  289. X#
  290. Xalink        type:=link;hostd==achilles.doc;fs:=/etc
  291. Xtlink        type:=link;hostd==truth.doc;fs:=/etc
  292. Xuucp        type:=link;hostd==truth.doc;fs:=/etc;sublink:=uucp
  293. X#
  294. X# Duplicate mounts to the same place
  295. X#
  296. Xdup1        -opts:=rw,grpid,nosuid \
  297. X        type:=nfs;rhost:=toytown.doc;rfs:=/home/toytown;fs:=/tmp/tt-home
  298. Xdup2        -opts:=rw,grpid,nosuid \
  299. X        type:=nfs;rhost:=ganymede.doc;rfs:=/home/ganymede;fs:=/tmp/tt-home
  300. X#
  301. X# Symlink
  302. X#
  303. Xlink        type:=link;fs:=dylan/dk2/adh
  304. X#
  305. X# Program mount
  306. X#
  307. Xexec        type:=program;mount:="/bin/true false";unmount:="/bin/true true"
  308. X#
  309. X# Alternate mount locations.
  310. X#
  311. Xalt        -host==truth;type:=nfs;rfs:=/var/spool/mail \
  312. X            rhost:=toytown rhost:=charm rhost:=gummo
  313. END_OF_FILE
  314. if test 2535 -ne `wc -c <'a_master'`; then
  315.     echo shar: \"'a_master'\" unpacked with wrong size!
  316. fi
  317. # end of 'a_master'
  318. fi
  319. if test -f 'amq-man' -a "${1}" != "-c" ; then 
  320.   echo shar: Will not clobber existing file \"'amq-man'\"
  321. else
  322. echo shar: Extracting \"'amq-man'\" \(2965 characters\)
  323. sed "s/^X//" >'amq-man' <<'END_OF_FILE'
  324. X'\" $Id: amq-man,v 5.1.1.1 90/01/11 16:59:39 jsp Exp Locker: jsp $
  325. X'\" Copyright (c) 1990 Jan-Simon Pendry
  326. X'\" Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  327. X'\" Copyright (c) 1990 The Regents of the University of California.
  328. X'\" All rights reserved.
  329. X'\"
  330. X'\" This code is derived from software contributed to Berkeley by
  331. X'\" Jan-Simon Pendry at Imperial College, London.
  332. X'\"
  333. X'\" Redistribution and use in source and binary forms are permitted
  334. X'\" provided that the above copyright notice and this paragraph are
  335. X'\" duplicated in all such forms and that any documentation,
  336. X'\" advertising materials, and other materials related to such
  337. X'\" distribution and use acknowledge that the software was developed
  338. X'\" by Imperial College of Science, Technology and Medicine, London, UK.
  339. X'\" The names of the College and University may not be used to endorse
  340. X'\" or promote products derived from this software without specific
  341. X'\" prior written permission.
  342. X'\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  343. X'\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  344. X'\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  345. X'\"
  346. X'\"    %W% (Berkeley) %G%
  347. X'\"
  348. X.TH AMQ 8 "25 April 1989"
  349. X.SH NAME
  350. Xamq \- automounter query tool
  351. X.SH SYNOPSIS
  352. X.B amq
  353. X[
  354. X.BI \-h " hostname"
  355. X] [
  356. X.B \-f
  357. X] [
  358. X.B \-m
  359. X] [
  360. X.B \-s
  361. X] [
  362. X.B \-u
  363. X]
  364. X[
  365. X.I directory
  366. X] .\|.\|.
  367. X.SH DESCRIPTION
  368. X.B Amq
  369. Xprovides a simple way of determining the current state of
  370. X.B amd
  371. Xprogram.
  372. XCommunication is by
  373. X.SM RPC.
  374. XThree modes of operation are supported by the current protocol.
  375. XBy default a list of mount points and auto-mounted filesystems
  376. Xis output.
  377. XAn alternative host can be specified using the
  378. X.I \-h
  379. Xoption.
  380. X.LP
  381. XIf directory names are given, as output by default,
  382. Xthen per-filesystem information is displayed.
  383. X.SH OPTIONS
  384. XThe
  385. X.I \-h
  386. Xoption specifies an alternate host to query.
  387. XBy default the local host is used.  In an
  388. X.SM HP-UX
  389. Xcluster, the root server is queried by default, since
  390. Xthat is the system on which the automounter is normally run.
  391. X.LP
  392. XThe
  393. X.I \-f option asks the automounter to flush the internal
  394. Xmount map cache.
  395. XThe
  396. X.I \-m
  397. Xoption asks the automounter to provide a list of mounted filesystems,
  398. Xincluding the number of references to each filesystem and any error
  399. Xwhich occured while mounting.
  400. XThe
  401. X.I \-s
  402. Xoption asks the automounter to provide system-wide mount statistics.
  403. X.LP
  404. XThe
  405. X.I \-u
  406. Xoption asks the automounter to unmount the named filesystems
  407. Xinstead of providing information about them.  Unmounts are requested,
  408. Xnot forced.  They merely cause the mounted filesystem to timeout,
  409. Xwhich will be picked up by
  410. X.BR amd 's
  411. Xmain scheduler thus causing the normal timeout action to be taken.
  412. X.SH FILES
  413. X.PD 0
  414. X.TP 20
  415. X.B amq.x
  416. X.SM RPC
  417. Xprotocol description.
  418. X.SH CAVEATS
  419. X.B Amq
  420. Xuses a Sun registered
  421. X.SM RPC
  422. Xprogram number (300019 decimal) which may not
  423. Xbe in the /etc/rpc database.
  424. X.SH "SEE ALSO"
  425. X.BR amd (8)
  426. X.SH AUTHOR
  427. XJan-Simon Pendry <jsp@doc.ic.ac.uk>
  428. END_OF_FILE
  429. if test 2965 -ne `wc -c <'amq-man'`; then
  430.     echo shar: \"'amq-man'\" unpacked with wrong size!
  431. fi
  432. # end of 'amq-man'
  433. fi
  434. if test -f 'amq_svc.c' -a "${1}" != "-c" ; then 
  435.   echo shar: Will not clobber existing file \"'amq_svc.c'\"
  436. else
  437. echo shar: Extracting \"'amq_svc.c'\" \(2993 characters\)
  438. sed "s/^X//" >'amq_svc.c' <<'END_OF_FILE'
  439. X/*
  440. X * $Id: amq_svc.c,v 5.1.1.1 90/01/11 17:04:11 jsp Exp Locker: jsp $
  441. X *
  442. X * Copyright (c) 1990 Jan-Simon Pendry
  443. X * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  444. X * Copyright (c) 1990 The Regents of the University of California.
  445. X * All rights reserved.
  446. X *
  447. X * This code is derived from software contributed to Berkeley by
  448. X * Jan-Simon Pendry at Imperial College, London.
  449. X *
  450. X * Redistribution and use in source and binary forms are permitted
  451. X * provided that the above copyright notice and this paragraph are
  452. X * duplicated in all such forms and that any documentation,
  453. X * advertising materials, and other materials related to such
  454. X * distribution and use acknowledge that the software was developed
  455. X * by Imperial College of Science, Technology and Medicine, London, UK.
  456. X * The names of the College and University may not be used to endorse
  457. X * or promote products derived from this software without specific
  458. X * prior written permission.
  459. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  460. X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  461. X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  462. X *
  463. X *    %W% (Berkeley) %G%
  464. X */
  465. X
  466. X#include "am.h"
  467. X#include "amq.h"
  468. Xextern bool_t xdr_amq_mount_info_qelem();
  469. X
  470. Xvoid
  471. Xamq_program_1(rqstp, transp)
  472. X    struct svc_req *rqstp;
  473. X    SVCXPRT *transp;
  474. X{
  475. X    union {
  476. X        amq_string amqproc_mnttree_1_arg;
  477. X        amq_string amqproc_umnt_1_arg;
  478. X        amq_setopt amqproc_setopt_1_arg;
  479. X    } argument;
  480. X    char *result;
  481. X    bool_t (*xdr_argument)(), (*xdr_result)();
  482. X    char *(*local)();
  483. X
  484. X    switch (rqstp->rq_proc) {
  485. X    case AMQPROC_NULL:
  486. X        xdr_argument = xdr_void;
  487. X        xdr_result = xdr_void;
  488. X        local = (char *(*)()) amqproc_null_1;
  489. X        break;
  490. X
  491. X    case AMQPROC_MNTTREE:
  492. X        xdr_argument = xdr_amq_string;
  493. X        xdr_result = xdr_amq_mount_tree_p;
  494. X        local = (char *(*)()) amqproc_mnttree_1;
  495. X        break;
  496. X
  497. X    case AMQPROC_UMNT:
  498. X        xdr_argument = xdr_amq_string;
  499. X        xdr_result = xdr_void;
  500. X        local = (char *(*)()) amqproc_umnt_1;
  501. X        break;
  502. X
  503. X    case AMQPROC_STATS:
  504. X        xdr_argument = xdr_void;
  505. X        xdr_result = xdr_amq_mount_stats;
  506. X        local = (char *(*)()) amqproc_stats_1;
  507. X        break;
  508. X
  509. X    case AMQPROC_EXPORT:
  510. X        xdr_argument = xdr_void;
  511. X        xdr_result = xdr_amq_mount_tree_list;
  512. X        local = (char *(*)()) amqproc_export_1;
  513. X        break;
  514. X
  515. X    case AMQPROC_SETOPT:
  516. X        xdr_argument = xdr_amq_setopt;
  517. X        xdr_result = xdr_int;
  518. X        local = (char *(*)()) amqproc_setopt_1;
  519. X        break;
  520. X
  521. X    case AMQPROC_GETMNTFS:
  522. X        xdr_argument = xdr_void;
  523. X        xdr_result = xdr_amq_mount_info_qelem;
  524. X        local = (char *(*)()) amqproc_getmntfs_1;
  525. X        break;
  526. X
  527. X    default:
  528. X        svcerr_noproc(transp);
  529. X        return;
  530. X    }
  531. X    bzero((char *)&argument, sizeof(argument));
  532. X    if (!svc_getargs(transp, xdr_argument, &argument)) {
  533. X        svcerr_decode(transp);
  534. X        return;
  535. X    }
  536. X    result = (*local)(&argument, rqstp);
  537. X    if (result != NULL && !svc_sendreply(transp, xdr_result, result)) {
  538. X        svcerr_systemerr(transp);
  539. X    }
  540. X    if (!svc_freeargs(transp, xdr_argument, &argument)) {
  541. X        plog(XLOG_FATAL, "unable to free rpc arguments in amqprog_1");
  542. X        going_down(1);
  543. X    }
  544. X}
  545. X
  546. END_OF_FILE
  547. if test 2993 -ne `wc -c <'amq_svc.c'`; then
  548.     echo shar: \"'amq_svc.c'\" unpacked with wrong size!
  549. fi
  550. # end of 'amq_svc.c'
  551. fi
  552. if test -f 'efs_ops.c' -a "${1}" != "-c" ; then 
  553.   echo shar: Will not clobber existing file \"'efs_ops.c'\"
  554. else
  555. echo shar: Extracting \"'efs_ops.c'\" \(2545 characters\)
  556. sed "s/^X//" >'efs_ops.c' <<'END_OF_FILE'
  557. X/*
  558. X * $Id: efs_ops.c,v 5.1.1.2 90/01/11 17:06:03 jsp Exp Locker: jsp $
  559. X *
  560. X * Copyright (c) 1989 Jan-Simon Pendry
  561. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  562. X * Copyright (c) 1989 The Regents of the University of California.
  563. X * All rights reserved.
  564. X *
  565. X * This code is derived from software contributed to Berkeley by
  566. X * Jan-Simon Pendry at Imperial College, London.
  567. X *
  568. X * Redistribution and use in source and binary forms are permitted
  569. X * provided that the above copyright notice and this paragraph are
  570. X * duplicated in all such forms and that any documentation,
  571. X * advertising materials, and other materials related to such
  572. X * distribution and use acknowledge that the software was developed
  573. X * by Imperial College of Science, Technology and Medicine, London, UK.
  574. X * The names of the College and University may not be used to endorse
  575. X * or promote products derived from this software without specific
  576. X * prior written permission.
  577. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  578. X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  579. X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  580. X *
  581. X *    %W% (Berkeley) %G%
  582. X */
  583. X
  584. X#include "am.h"
  585. X
  586. X#ifdef HAS_EFS
  587. X
  588. X/*
  589. X * Error file system.
  590. X * This is used as a last resort catchall if
  591. X * nothing else worked.  EFS just returns lots
  592. X * of error codes, except for unmount which
  593. X * always works of course.
  594. X */
  595. X
  596. X/*
  597. X * EFS file system always matches
  598. X */
  599. Xstatic int efs_match(fo)
  600. Xam_opts *fo;
  601. X{
  602. X    fo->fs_mtab = strealloc(fo->fs_mtab, "(error-hook)");
  603. X    return 1;
  604. X}
  605. X
  606. X/*ARGSUSED*/
  607. Xstatic int efs_mount(mp)
  608. Xam_node *mp;
  609. X{
  610. X    return ENOENT;
  611. X}
  612. X
  613. X/*ARGSUSED*/
  614. Xstatic int efs_umount(mp)
  615. Xam_node *mp;
  616. X{
  617. X    /*
  618. X     * Always succeed
  619. X     */
  620. X
  621. X    return 0;
  622. X}
  623. X
  624. X/*
  625. X * EFS interface to RPC lookup() routine.
  626. X * Should never get here in the automounter.
  627. X * If we do then just give an error.
  628. X */
  629. X/*ARGSUSED*/
  630. Xam_node *efs_lookuppn(mp, fname, error_return, op)
  631. Xam_node *mp;
  632. Xchar *fname;
  633. Xint *error_return;
  634. Xint op;
  635. X{
  636. X    *error_return = ESTALE;
  637. X    return 0;
  638. X}
  639. X
  640. X/*
  641. X * EFS interface to RPC readdir() routine.
  642. X * Should never get here in the automounter.
  643. X * If we do then just give an error.
  644. X */
  645. X/*ARGSUSED*/
  646. Xint efs_readdir(mp, cookie, dp, ep)
  647. Xam_node *mp;
  648. Xnfscookie cookie;
  649. Xdirlist *dp;
  650. Xentry *ep;
  651. X{
  652. X    return ESTALE;
  653. X}
  654. X
  655. X/*
  656. X * Ops structure
  657. X */
  658. Xam_ops efs_ops = {
  659. X    "error",
  660. X    efs_match,
  661. X    0, /* efs_init */
  662. X    efs_mount,
  663. X    efs_umount,
  664. X    efs_lookuppn,
  665. X    efs_readdir,
  666. X    0, /* efs_readlink */
  667. X    0, /* efs_mounted */
  668. X    0, /* efs_umounted */
  669. X    find_afs_srvr,
  670. X    FS_DISCARD,
  671. X    &afs_srvr_list
  672. X};
  673. X
  674. X#endif
  675. END_OF_FILE
  676. if test 2545 -ne `wc -c <'efs_ops.c'`; then
  677.     echo shar: \"'efs_ops.c'\" unpacked with wrong size!
  678. fi
  679. # end of 'efs_ops.c'
  680. fi
  681. if test -f 'fs.h' -a "${1}" != "-c" ; then 
  682.   echo shar: Will not clobber existing file \"'fs.h'\"
  683. else
  684. echo shar: Extracting \"'fs.h'\" \(2806 characters\)
  685. sed "s/^X//" >'fs.h' <<'END_OF_FILE'
  686. X/* $Id: fs.h,v 5.1 89/11/17 18:19:58 jsp Exp Locker: jsp $ */
  687. X
  688. X/*
  689. X * File system types
  690. X *
  691. X * Copyright (c) 1989 Jan-Simon Pendry
  692. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  693. X * Copyright (c) 1989 The Regents of the University of California.
  694. X * All rights reserved.
  695. X *
  696. X * This code is derived from software contributed to Berkeley by
  697. X * Jan-Simon Pendry at Imperial College, London.
  698. X *
  699. X * Redistribution and use in source and binary forms are permitted
  700. X * provided that the above copyright notice and this paragraph are
  701. X * duplicated in all such forms and that any documentation,
  702. X * advertising materials, and other materials related to such
  703. X * distribution and use acknowledge that the software was developed
  704. X * by Imperial College of Science, Technology and Medicine, London, UK.
  705. X * The names of the College and University may not be used to endorse
  706. X * or promote products derived from this software without specific
  707. X * prior written permission.
  708. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  709. X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  710. X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  711. X *
  712. X *    %W% (Berkeley) %G%
  713. X */
  714. X
  715. X/*
  716. X * Automount File System
  717. X */
  718. X#define HAS_AFS
  719. Xextern am_ops    afs_ops;    /* Automount file system (this!) */
  720. Xextern qelem    afs_srvr_list;
  721. Xextern fserver *find_afs_srvr P((mntfs*));
  722. X
  723. X
  724. X/*
  725. X * Direct Automount File System
  726. X */
  727. X#define    HAS_DFS
  728. Xextern am_ops    dfs_ops;    /* Direct Automount file system (this too) */
  729. X
  730. X/*
  731. X * Error File System
  732. X */
  733. X#define HAS_EFS
  734. Xextern am_ops    efs_ops;    /* Error file system */
  735. X
  736. X/*
  737. X * Inheritance File System
  738. X */
  739. X#define HAS_IFS
  740. Xextern am_ops    ifs_ops;    /* Inheritance file system */
  741. X
  742. X/*
  743. X * Loopback File System
  744. X * LOFS is optional - you can compile without it.
  745. X */
  746. X#ifdef OS_HAS_LOFS
  747. X/*
  748. X * Most systems can't support this, and in
  749. X * any case most of the functionality is
  750. X * available with Symlink FS.  In fact,
  751. X * lofs_ops is not yet available.
  752. X */
  753. X#define HAS_LOFS
  754. Xextern am_ops lofs_ops;
  755. X#endif
  756. X
  757. X/*
  758. X * Netw*rk File System
  759. X * Good, slow, NFS.
  760. X */
  761. X#define HAS_NFS
  762. Xextern am_ops    nfs_ops;    /* NFS */
  763. Xextern qelem    nfs_srvr_list;
  764. Xextern fserver *find_nfs_srvr P((mntfs*));
  765. X
  766. X/*
  767. X * Program File System
  768. X * PFS is optional - you can compile without it.
  769. X * This is useful for things like RVD.
  770. X */
  771. X#define HAS_PFS
  772. Xextern am_ops    pfs_ops;    /* PFS */
  773. X
  774. X/*
  775. X * Translucent File System
  776. X * TFS is optional - you can compile without it.
  777. X * This is just plain cute.
  778. X */
  779. X#ifdef notdef
  780. Xextern am_ops    tfs_ops;    /* TFS */
  781. X#endif
  782. X#undef    HAS_TFS
  783. X
  784. X/*
  785. X * Un*x File System
  786. X * Normal local disk file system.
  787. X */
  788. X#define HAS_UFS
  789. Xextern am_ops    ufs_ops;    /* Un*x file system */
  790. X
  791. X/*
  792. X * Symbolic-link file system
  793. X * A "filesystem" which is just a symbol link.
  794. X */
  795. X#define HAS_SFS
  796. Xextern am_ops    sfs_ops;    /* Symlink FS */
  797. END_OF_FILE
  798. if test 2806 -ne `wc -c <'fs.h'`; then
  799.     echo shar: \"'fs.h'\" unpacked with wrong size!
  800. fi
  801. # end of 'fs.h'
  802. fi
  803. if test -f 'hpux.h' -a "${1}" != "-c" ; then 
  804.   echo shar: Will not clobber existing file \"'hpux.h'\"
  805. else
  806. echo shar: Extracting \"'hpux.h'\" \(2335 characters\)
  807. sed "s/^X//" >'hpux.h' <<'END_OF_FILE'
  808. X/*
  809. X * $Id: hpux.h,v 5.1 89/11/17 18:23:04 jsp Exp Locker: jsp $
  810. X *
  811. X * Copyright (c) 1989 Jan-Simon Pendry
  812. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  813. X * Copyright (c) 1989 The Regents of the University of California.
  814. X * All rights reserved.
  815. X *
  816. X * This code is derived from software contributed to Berkeley by
  817. X * Jan-Simon Pendry at Imperial College, London.
  818. X *
  819. X * Redistribution and use in source and binary forms are permitted
  820. X * provided that the above copyright notice and this paragraph are
  821. X * duplicated in all such forms and that any documentation,
  822. X * advertising materials, and other materials related to such
  823. X * distribution and use acknowledge that the software was developed
  824. X * by Imperial College of Science, Technology and Medicine, London, UK.
  825. X * The names of the College and University may not be used to endorse
  826. X * or promote products derived from this software without specific
  827. X * prior written permission.
  828. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  829. X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  830. X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  831. X *
  832. X *    %W% (Berkeley) %G%
  833. X */
  834. X
  835. X/*
  836. X * These definitions are from <nfs/nfs.h>
  837. X * Unfortunately, that file cannot be included
  838. X * because it contains lots of structure definitions
  839. X * that are not wanted (they produce name clashes).
  840. X * Isn't HP-UX wonderful!
  841. X */
  842. X
  843. X/*
  844. X * HP-UX specific definitions
  845. X */
  846. Xstruct nfs_args {
  847. X    struct sockaddr_in    *addr;        /* file server address */
  848. X    fhandle_t        *fh;        /* File handle to be mounted */
  849. X    int            flags;        /* flags */
  850. X    int            wsize;        /* write size in bytes */
  851. X    int            rsize;        /* read size in bytes */
  852. X    int            timeo;        /* initial timeout in .1 secs */
  853. X    int            retrans;    /* times to retry send */
  854. X    char            *hostname;    /* server's name */
  855. X};
  856. X
  857. X/*
  858. X * NFS mount option flags
  859. X */
  860. X#define    NFSMNT_SOFT    0x001    /* soft mount (hard is default) */
  861. X#define    NFSMNT_WSIZE    0x002    /* set write size */
  862. X#define    NFSMNT_RSIZE    0x004    /* set read size */
  863. X#define    NFSMNT_TIMEO    0x008    /* set initial timeout */
  864. X#define    NFSMNT_RETRANS    0x010    /* set number of request retrys */
  865. X#define    NFSMNT_HOSTNAME    0x020    /* set hostname for error printf */
  866. X#define    NFSMNT_INT    0x040    /* set option to have interruptable mounts */
  867. X#define    NFSMNT_NODEVS   0x080   /* turn off device file access (default on) */
  868. END_OF_FILE
  869. if test 2335 -ne `wc -c <'hpux.h'`; then
  870.     echo shar: \"'hpux.h'\" unpacked with wrong size!
  871. fi
  872. # end of 'hpux.h'
  873. fi
  874. if test -f 'info_hes.c' -a "${1}" != "-c" ; then 
  875.   echo shar: Will not clobber existing file \"'info_hes.c'\"
  876. else
  877. echo shar: Extracting \"'info_hes.c'\" \(2595 characters\)
  878. sed "s/^X//" >'info_hes.c' <<'END_OF_FILE'
  879. X/*
  880. X * $Id: info_hes.c,v 5.1.1.1 89/11/28 17:46:59 jsp Exp Locker: jsp $
  881. X *
  882. X * Copyright (c) 1989 Jan-Simon Pendry
  883. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  884. X * Copyright (c) 1989 The Regents of the University of California.
  885. X * All rights reserved.
  886. X *
  887. X * This code is derived from software contributed to Berkeley by
  888. X * Jan-Simon Pendry at Imperial College, London.
  889. X *
  890. X * Redistribution and use in source and binary forms are permitted
  891. X * provided that the above copyright notice and this paragraph are
  892. X * duplicated in all such forms and that any documentation,
  893. X * advertising materials, and other materials related to such
  894. X * distribution and use acknowledge that the software was developed
  895. X * by Imperial College of Science, Technology and Medicine, London, UK.
  896. X * The names of the College and University may not be used to endorse
  897. X * or promote products derived from this software without specific
  898. X * prior written permission.
  899. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  900. X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  901. X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  902. X *
  903. X *    %W% (Berkeley) %G%
  904. X */
  905. X
  906. X/*
  907. X * Get info from Hesiod
  908. X */
  909. X
  910. X#include "am.h"
  911. X
  912. X#ifdef HAS_HESIOD_MAPS
  913. X#include <hesiod.h>
  914. X
  915. X#define    HES_PREFIX    "hesiod."
  916. X#define    HES_PREFLEN    7
  917. X
  918. X/*
  919. X * No way to probe the server - check the map name begins with "hesiod."
  920. X */
  921. Xhesiod_init(map)
  922. Xchar *map;
  923. X{
  924. X    return strncmp(map, HES_PREFIX, HES_PREFLEN) == 0 ? 0 : ENOENT;
  925. X}
  926. X
  927. X
  928. X/*
  929. X * Do a Hesiod nameserver call.
  930. X * Modify time is ignored by Hesiod - XXX
  931. X */
  932. Xint hesiod_search(m, map, key, pval, tp)
  933. Xmnt_map *m;
  934. Xchar *map;
  935. Xchar *key;
  936. Xchar **pval;
  937. Xtime_t *tp;
  938. X{
  939. X    int error;
  940. X    char hes_map[MAXPATHLEN];
  941. X    char **rvec;
  942. X    /*
  943. X     * Make Hesiod name.  Skip past the "hesiod."
  944. X     * at the start of the map name and append
  945. X     * ".automount".  The net effect is that a lookup
  946. X     * of /defaults in hesiod.home will result in a
  947. X     * call to hes_resolve("/defaults", "home.automount");
  948. X     */
  949. X    sprintf(hes_map, "%s%s", map + HES_PREFLEN, ".automount");
  950. X    /*
  951. X     * Call the resolver
  952. X     */
  953. X    rvec = hes_resolve(key, hes_map);
  954. X    /*
  955. X     * If a reply was forthcoming then return
  956. X     * it (and free subsequent replies)
  957. X     */
  958. X    if (rvec && *rvec) {
  959. X        *pval = *rvec;
  960. X        while (*++rvec)
  961. X            free(*rvec);
  962. X        return 0;
  963. X    }
  964. X
  965. X    /*
  966. X     * Otherwise reflect the hesiod error into a Un*x error
  967. X     */
  968. X    switch (hes_error()) {
  969. X    case HES_ER_NOTFOUND:    error = ENOENT; break;
  970. X    case HES_ER_CONFIG:    error = EIO; break;
  971. X    case HES_ER_NET:    error = ETIMEDOUT; break;
  972. X    default:        error = EINVAL; break;
  973. X    }
  974. X    return error;
  975. X}
  976. X#endif
  977. END_OF_FILE
  978. if test 2595 -ne `wc -c <'info_hes.c'`; then
  979.     echo shar: \"'info_hes.c'\" unpacked with wrong size!
  980. fi
  981. # end of 'info_hes.c'
  982. fi
  983. if test -f 'info_yp.c' -a "${1}" != "-c" ; then 
  984.   echo shar: Will not clobber existing file \"'info_yp.c'\"
  985. else
  986. echo shar: Extracting \"'info_yp.c'\" \(2555 characters\)
  987. sed "s/^X//" >'info_yp.c' <<'END_OF_FILE'
  988. X/*
  989. X * $Id: info_yp.c,v 5.1 89/11/17 18:20:22 jsp Exp Locker: jsp $
  990. X *
  991. X * Copyright (c) 1989 Jan-Simon Pendry
  992. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  993. X * Copyright (c) 1989 The Regents of the University of California.
  994. X * All rights reserved.
  995. X *
  996. X * This code is derived from software contributed to Berkeley by
  997. X * Jan-Simon Pendry at Imperial College, London.
  998. X *
  999. X * Redistribution and use in source and binary forms are permitted
  1000. X * provided that the above copyright notice and this paragraph are
  1001. X * duplicated in all such forms and that any documentation,
  1002. X * advertising materials, and other materials related to such
  1003. X * distribution and use acknowledge that the software was developed
  1004. X * by Imperial College of Science, Technology and Medicine, London, UK.
  1005. X * The names of the College and University may not be used to endorse
  1006. X * or promote products derived from this software without specific
  1007. X * prior written permission.
  1008. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  1009. X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  1010. X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  1011. X *
  1012. X *    %W% (Berkeley) %G%
  1013. X */
  1014. X
  1015. X/*
  1016. X * Get info from YP map
  1017. X */
  1018. X
  1019. X#include "am.h"
  1020. X
  1021. X#ifdef HAS_YP_MAPS
  1022. X#include <rpcsvc/yp_prot.h>
  1023. X#include <rpcsvc/ypclnt.h>
  1024. X
  1025. X/*
  1026. X * Figure out the yp domain name
  1027. X */
  1028. Xstatic int determine_yp_domain(P_void)
  1029. X{
  1030. Xstatic     char default_domain[YPMAXDOMAIN];
  1031. X
  1032. X    if (getdomainname(default_domain, sizeof(default_domain)) < 0) {
  1033. X        plog(XLOG_ERROR, "getdomainname: %m");
  1034. X        return EIO;
  1035. X    }
  1036. X
  1037. X    domain = default_domain;
  1038. X    if (!*domain) {
  1039. X        plog(XLOG_ERROR, "YP domain name is not set");
  1040. X        return ENOENT;
  1041. X    }
  1042. X
  1043. X    return 0;
  1044. X}
  1045. X
  1046. X/*
  1047. X * Try to locate a key using Yellow Pages.
  1048. X * Modify time is ignored in YP - XXX
  1049. X */
  1050. Xint yp_search(m, map, key, val, tp)
  1051. Xmnt_map *m;
  1052. Xchar *map;
  1053. Xchar *key;
  1054. Xchar **val;
  1055. Xtime_t *tp;
  1056. X{
  1057. X    int outlen;
  1058. X    int res;
  1059. X
  1060. X    if (!domain) {
  1061. X        int error = determine_yp_domain();
  1062. X        if (error)
  1063. X            return error;
  1064. X    }
  1065. X
  1066. X    res = yp_match(domain, map, key, strlen(key), val, &outlen);
  1067. X
  1068. X    /*
  1069. X     * Do something interesting with the return code
  1070. X     */
  1071. X    switch (res) {
  1072. X    case 0:
  1073. X        return 0;
  1074. X
  1075. X    case YPERR_KEY:
  1076. X        return ENOENT;
  1077. X
  1078. X    default:
  1079. X        plog(XLOG_ERROR, "%s: %s", map, yperr_string(res));
  1080. X        return EIO;
  1081. X    }
  1082. X}
  1083. X
  1084. Xint yp_init(map)
  1085. Xchar *map;
  1086. X{
  1087. X    char *name = 0;
  1088. X
  1089. X    if (!domain) {
  1090. X        int error = determine_yp_domain();
  1091. X        if (error)
  1092. X            return error;
  1093. X    }
  1094. X
  1095. X    /*
  1096. X     * To see if the map exists, try to find
  1097. X     * a master for it.
  1098. X     */
  1099. X    if (yp_master(domain, map, &name))
  1100. X        return ENOENT;
  1101. X    free(name);
  1102. X    return 0;
  1103. X}
  1104. X#endif
  1105. END_OF_FILE
  1106. if test 2555 -ne `wc -c <'info_yp.c'`; then
  1107.     echo shar: \"'info_yp.c'\" unpacked with wrong size!
  1108. fi
  1109. # end of 'info_yp.c'
  1110. fi
  1111. if test -f 'os-aux.h' -a "${1}" != "-c" ; then 
  1112.   echo shar: Will not clobber existing file \"'os-aux.h'\"
  1113. else
  1114. echo shar: Extracting \"'os-aux.h'\" \(2713 characters\)
  1115. sed "s/^X//" >'os-aux.h' <<'END_OF_FILE'
  1116. X/* $Id: os-aux.h,v 5.1 89/11/17 18:22:42 jsp Exp Locker: jsp $ */
  1117. X
  1118. X/*
  1119. X * A/UX macII definitions for Amd (automounter)
  1120. X * Contributed by Julian Onions <jpo@cs.nott.ac.uk>
  1121. X *
  1122. X * Copyright (c) 1989 Jan-Simon Pendry
  1123. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  1124. X * Copyright (c) 1989 The Regents of the University of California.
  1125. X * All rights reserved.
  1126. X *
  1127. X * This code is derived from software contributed to Berkeley by
  1128. X * Jan-Simon Pendry at Imperial College, London.
  1129. X *
  1130. X * Redistribution and use in source and binary forms are permitted
  1131. X * provided that the above copyright notice and this paragraph are
  1132. X * duplicated in all such forms and that any documentation,
  1133. X * advertising materials, and other materials related to such
  1134. X * distribution and use acknowledge that the software was developed
  1135. X * by Imperial College of Science, Technology and Medicine, London, UK.
  1136. X * The names of the College and University may not be used to endorse
  1137. X * or promote products derived from this software without specific
  1138. X * prior written permission.
  1139. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  1140. X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  1141. X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  1142. X *
  1143. X *    %W% (Berkeley) %G%
  1144. X */
  1145. X
  1146. X/*
  1147. X * Does the compiler grok void *
  1148. X */
  1149. X#define    VOIDP
  1150. X
  1151. X/*
  1152. X * Which version of the Sun RPC library we are using
  1153. X * This is the implementation release number, not
  1154. X * the protocol revision number.
  1155. X */
  1156. X#define    RPC_3
  1157. X
  1158. X/*
  1159. X * Which version of the NFS interface are we using.
  1160. X * This is the implementation release number, not
  1161. X * the protocol revision number.
  1162. X */
  1163. X#define    NFS_3
  1164. X
  1165. X/*
  1166. X * Byte ordering
  1167. X */
  1168. X#undef ARCH_ENDIAN
  1169. X#define    ARCH_ENDIAN    "big"
  1170. X
  1171. X/*
  1172. X * Has support for syslog()
  1173. X */
  1174. X#define HAS_SYSLOG
  1175. X
  1176. X/*
  1177. X * No support for ndbm
  1178. X */
  1179. X#undef OS_HAS_NDBM
  1180. X
  1181. X/*
  1182. X * Name of filesystem types
  1183. X */
  1184. X#define    MOUNT_TYPE_UFS    MOUNT_UFS
  1185. X#define MOUNT_TYPE_NFS MOUNT_NFS
  1186. X
  1187. X#undef MTAB_TYPE_UFS
  1188. X#define    MTAB_TYPE_UFS    "5.2"
  1189. X
  1190. X#define SIGCHLD    SIGCLD
  1191. X#define    SYS5_SIGNALS
  1192. X
  1193. X/*
  1194. X * Use <fcntl.h> rather than <sys/file.h>
  1195. X */
  1196. X#define USE_FCNTL
  1197. X
  1198. X/*
  1199. X * Use fcntl() rather than flock()
  1200. X */
  1201. X#define LOCK_FCNTL
  1202. X
  1203. X#ifdef __GNUC__
  1204. X#define alloca(sz) __builtin_alloca(sz)
  1205. X#endif
  1206. X
  1207. X#define    bzero(ptr, len)    memset(ptr, 0, len)
  1208. X#define bcopy(from, to, len) memcpy(to, from, len)
  1209. X#define getpagesize() (2048)
  1210. X#undef MOUNT_TRAP
  1211. X#define MOUNT_TRAP(type, mnt, flags, mnt_data) \
  1212. X    fsmount(type, mnt->mnt_dir, flags, mnt_data)
  1213. X#undef UNMOUNT_TRAP
  1214. X#define    UNMOUNT_TRAP(mnt)    unmount(mnt->mnt_dir)
  1215. X#define NFDS    30    /* conservative */
  1216. X
  1217. X/* not included in sys/param.h */
  1218. X#include <sys/types.h>
  1219. X/* not part of sys/time.h */
  1220. X#include <time.h>
  1221. X/* for NMOUNT */
  1222. X#include <sys/config.h>
  1223. END_OF_FILE
  1224. if test 2713 -ne `wc -c <'os-aux.h'`; then
  1225.     echo shar: \"'os-aux.h'\" unpacked with wrong size!
  1226. fi
  1227. # end of 'os-aux.h'
  1228. fi
  1229. if test -f 'os-defaults.h' -a "${1}" != "-c" ; then 
  1230.   echo shar: Will not clobber existing file \"'os-defaults.h'\"
  1231. else
  1232. echo shar: Extracting \"'os-defaults.h'\" \(2660 characters\)
  1233. sed "s/^X//" >'os-defaults.h' <<'END_OF_FILE'
  1234. X/* $Id: os-defaults.h,v 5.1.1.1 89/11/28 18:02:38 jsp Exp Locker: jsp $ */
  1235. X
  1236. X/*
  1237. X * Common OS definitions.  These may be overridden in
  1238. X * the OS specific files ("os-foo.h").
  1239. X *
  1240. X * Copyright (c) 1989 Jan-Simon Pendry
  1241. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  1242. X * Copyright (c) 1989 The Regents of the University of California.
  1243. X * All rights reserved.
  1244. X *
  1245. X * This code is derived from software contributed to Berkeley by
  1246. X * Jan-Simon Pendry at Imperial College, London.
  1247. X *
  1248. X * Redistribution and use in source and binary forms are permitted
  1249. X * provided that the above copyright notice and this paragraph are
  1250. X * duplicated in all such forms and that any documentation,
  1251. X * advertising materials, and other materials related to such
  1252. X * distribution and use acknowledge that the software was developed
  1253. X * by Imperial College of Science, Technology and Medicine, London, UK.
  1254. X * The names of the College and University may not be used to endorse
  1255. X * or promote products derived from this software without specific
  1256. X * prior written permission.
  1257. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  1258. X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  1259. X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  1260. X *
  1261. X *    %W% (Berkeley) %G%
  1262. X */
  1263. X
  1264. X/*
  1265. X * What level of AMD are we backward compatible with?
  1266. X * This only applies to externally visible characteristics.
  1267. X * Rev.Minor.Branch.Patch (2 digits each)
  1268. X */
  1269. X#define    AMD_COMPAT    5000000        /* 5.0 */
  1270. X
  1271. X/*
  1272. X * Is the mount table mirrored in software
  1273. X */
  1274. X#define    UPDATE_MTAB
  1275. X
  1276. X/*
  1277. X * Where to get union wait
  1278. X */
  1279. X#define    WAIT    <sys/wait.h>
  1280. X
  1281. X/*
  1282. X * Where to get mount entry info
  1283. X */
  1284. X#define    MNTENT_HDR    <mntent.h>
  1285. X
  1286. X/*
  1287. X * Include support for syslog()
  1288. X */
  1289. X#define    HAS_SYSLOG
  1290. X
  1291. X/*
  1292. X * Byte ordering
  1293. X */
  1294. X#define    ARCH_ENDIAN    "unknown"
  1295. X
  1296. X/*
  1297. X * Name of filesystem types
  1298. X */
  1299. X#define    MTAB_TYPE_NFS    "nfs"
  1300. X#define    MTAB_TYPE_UFS    "4.2"
  1301. X
  1302. X/*
  1303. X * Name of mount & unmount system calls
  1304. X *
  1305. X * NOTE:
  1306. X *  UNMOUNT_TRAP takes a struct mntent *
  1307. X */
  1308. X#define    MOUNT_TRAP(type, mnt, flags, mnt_data) \
  1309. X    mount(type, mnt->mnt_dir, flags, mnt_data)
  1310. X#define    UNMOUNT_TRAP(mnt)    unmount(mnt->mnt_dir)
  1311. X
  1312. X/*
  1313. X * How to unmount filesystems.
  1314. X * NEED_UMOUNT_FS includes code to scan the mount table
  1315. X * to find the correct information for the unmount system
  1316. X * call.  Some systems, such as 4.4bsd, do not require
  1317. X * this - they can just do an unmount system call directly.
  1318. X */
  1319. X#define    NEED_UMOUNT_FS
  1320. X#define    UMOUNT_FS(dir)    umount_fs(dir)
  1321. X
  1322. X/*
  1323. X * Type of a file handle
  1324. X */
  1325. X#define    NFS_FH_TYPE    fhandle_t *
  1326. X
  1327. X/*
  1328. X * Type of filesystem type
  1329. X */
  1330. X#define    MTYPE_TYPE    int
  1331. X
  1332. X/*
  1333. X * How to get a mount list
  1334. X */
  1335. X#define    READ_MTAB_FROM_FILE
  1336. END_OF_FILE
  1337. if test 2660 -ne `wc -c <'os-defaults.h'`; then
  1338.     echo shar: \"'os-defaults.h'\" unpacked with wrong size!
  1339. fi
  1340. # end of 'os-defaults.h'
  1341. fi
  1342. if test -f 'os-hpux.h' -a "${1}" != "-c" ; then 
  1343.   echo shar: Will not clobber existing file \"'os-hpux.h'\"
  1344. else
  1345. echo shar: Extracting \"'os-hpux.h'\" \(2885 characters\)
  1346. sed "s/^X//" >'os-hpux.h' <<'END_OF_FILE'
  1347. X/* $Id: os-hpux.h,v 5.1.1.1 89/11/28 18:04:01 jsp Exp Locker: jsp $ */
  1348. X
  1349. X/*
  1350. X * HP/9000 HP-UX definitions for Amd (automounter)
  1351. X *
  1352. X * Copyright (c) 1989 Jan-Simon Pendry
  1353. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  1354. X * Copyright (c) 1989 The Regents of the University of California.
  1355. X * All rights reserved.
  1356. X *
  1357. X * This code is derived from software contributed to Berkeley by
  1358. X * Jan-Simon Pendry at Imperial College, London.
  1359. X *
  1360. X * Redistribution and use in source and binary forms are permitted
  1361. X * provided that the above copyright notice and this paragraph are
  1362. X * duplicated in all such forms and that any documentation,
  1363. X * advertising materials, and other materials related to such
  1364. X * distribution and use acknowledge that the software was developed
  1365. X * by Imperial College of Science, Technology and Medicine, London, UK.
  1366. X * The names of the College and University may not be used to endorse
  1367. X * or promote products derived from this software without specific
  1368. X * prior written permission.
  1369. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  1370. X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  1371. X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  1372. X *
  1373. X *    %W% (Berkeley) %G%
  1374. X */
  1375. X
  1376. X/*
  1377. X * Does the compiler grok void *
  1378. X */
  1379. X#ifdef __GNUC__
  1380. X#define    VOIDP
  1381. X#endif
  1382. X
  1383. X/*
  1384. X * Which version of the Sun RPC library we are using
  1385. X * This is the implementation release number, not
  1386. X * the protocol revision number.
  1387. X */
  1388. X#define    RPC_3
  1389. X
  1390. X/*
  1391. X * Which version of the NFS interface are we using.
  1392. X * This is the implementation release number, not
  1393. X * the protocol revision number.
  1394. X */
  1395. X#define    NFS_3
  1396. X
  1397. X/*
  1398. X * Byte ordering
  1399. X */
  1400. X#undef ARCH_ENDIAN
  1401. X#if defined(hp9000s200) || defined(hp9000s300)
  1402. X#define    ARCH_ENDIAN    "big"
  1403. X#endif
  1404. X/*
  1405. X#if defined(hp9000s800)
  1406. X#define ARCH_ENDIAN    "unknown"
  1407. X#endif
  1408. X*/
  1409. X
  1410. X/*
  1411. X * No support for syslog()
  1412. X */
  1413. X#undef HAS_SYSLOG
  1414. X
  1415. X/*
  1416. X * No support for ndbm
  1417. X */
  1418. X#undef OS_HAS_NDBM
  1419. X
  1420. X/*
  1421. X * Name of filesystem types
  1422. X */
  1423. X#define    MOUNT_TYPE_UFS    MOUNT_UFS
  1424. X#define MOUNT_TYPE_NFS MOUNT_NFS
  1425. X#undef MTAB_TYPE_UFS
  1426. X#define    MTAB_TYPE_UFS    "hfs"
  1427. X
  1428. X/*
  1429. X * Where to get NFS definitions
  1430. X */
  1431. X#define    NFS_HDR "hpux.h"
  1432. X
  1433. X/*
  1434. X * Where to get union wait
  1435. X */
  1436. X#undef WAIT
  1437. X#define    WAIT    "uwait.h"
  1438. X#define SIGCHLD    SIGCLD
  1439. X#define    SYS5_SIGNALS
  1440. X
  1441. X/*
  1442. X * Miscellaneous HP-UX definitions
  1443. X */
  1444. X
  1445. X#define    MISC_RPC
  1446. X
  1447. X/*
  1448. X * Use <fcntl.h> rather than <sys/file.h>
  1449. X */
  1450. X#define USE_FCNTL
  1451. X
  1452. X/*
  1453. X * Use fcntl() rather than flock()
  1454. X */
  1455. X#define LOCK_FCNTL
  1456. X
  1457. X#ifdef __GNUC__
  1458. X#define alloca(sz) __builtin_alloca(sz)
  1459. X#endif
  1460. X#define    bzero(ptr, len)    memset(ptr, 0, len)
  1461. X#define bcopy(from, to, len) memcpy(to, from, len)
  1462. X#define getpagesize() (2048)
  1463. X#undef MOUNT_TRAP
  1464. X#define MOUNT_TRAP(type, mnt, flags, mnt_data) \
  1465. X    vfsmount(type, mnt->mnt_dir, flags, mnt_data)
  1466. X#undef UNMOUNT_TRAP
  1467. X#define    UNMOUNT_TRAP(mnt)    umount(mnt->mnt_dir)
  1468. X#define NFDS    30    /* conservative */
  1469. X#define    MOUNTED MNT_MNTTAB
  1470. END_OF_FILE
  1471. if test 2885 -ne `wc -c <'os-hpux.h'`; then
  1472.     echo shar: \"'os-hpux.h'\" unpacked with wrong size!
  1473. fi
  1474. # end of 'os-hpux.h'
  1475. fi
  1476. if test -f 'os-type' -a "${1}" != "-c" ; then 
  1477.   echo shar: Will not clobber existing file \"'os-type'\"
  1478. else
  1479. echo shar: Extracting \"'os-type'\" \(2728 characters\)
  1480. sed "s/^X//" >'os-type' <<'END_OF_FILE'
  1481. X#!/bin/sh
  1482. X#
  1483. X# $Id: os-type,v 5.1.1.2 90/01/11 17:16:09 jsp Exp Locker: jsp $
  1484. X#
  1485. X# Copyright (c) 1989 Jan-Simon Pendry
  1486. X# Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  1487. X# Copyright (c) 1989 The Regents of the University of California.
  1488. X# All rights reserved.
  1489. X#
  1490. X# This code is derived from software contributed to Berkeley by
  1491. X# Jan-Simon Pendry at Imperial College, London.
  1492. X#
  1493. X# Redistribution and use in source and binary forms are permitted
  1494. X# provided that the above copyright notice and this paragraph are
  1495. X# duplicated in all such forms and that any documentation,
  1496. X# advertising materials, and other materials related to such
  1497. X# distribution and use acknowledge that the software was developed
  1498. X# by Imperial College of Science, Technology and Medicine, London, UK.
  1499. X# The names of the College and University may not be used to endorse
  1500. X# or promote products derived from this software without specific
  1501. X# prior written permission.
  1502. X# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  1503. X# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  1504. X# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  1505. X#
  1506. X#    %W% (Berkeley) %G%
  1507. X#
  1508. X
  1509. X#
  1510. X# Take a pot-shot at your os type
  1511. X#
  1512. Xecho "    ... No OS= option specified; dynamically determining OS type" >&2
  1513. X
  1514. X#
  1515. X# First try poking around in /etc/motd
  1516. X#
  1517. X
  1518. Xcase "`exec 2>/dev/null; head -2 /etc/motd`" in
  1519. X*"Sun UNIX 4.2 Release 3."*)    OS=sos3;;
  1520. X*"SunOS Release 4."*)        OS=sos4;;
  1521. X*"HP-UX on the HP"*)        OS=hpux;;
  1522. X*"Ultrix V2."*)            OS=u2_2;;
  1523. X*"Ultrix-32 V3."*)        OS=u3_0;;
  1524. X*"Ultrix Worksystem V2.0"*)    OS=u3_0;;
  1525. X*"HLH OTS Version 1."*)        OS=hlh42;;
  1526. X*"RISC iX release 1."*)        OS=riscix;;
  1527. X*"4.4 BSD UNIX"*)        OS=bsd44;;
  1528. X*"4.3 BSD UNIX"*)        if [ -f /etc/minidisk ]; then
  1529. X                    OS=acis43
  1530. X                elif [ -f /sbin/nfsiod ]; then
  1531. X                    OS=bsd44    # prototype
  1532. X                else
  1533. X                    OS=xinu43
  1534. X                fi;;
  1535. X*"Alliant Concentrix"*)        OS=concentrix;;
  1536. X*"Umax 4.3"*)            OS=umax43;;
  1537. X*)
  1538. X#
  1539. X# Well, that didn't work so apply some heuristics
  1540. X# to the filesystem name space...
  1541. X#
  1542. X                echo "    ... inspecting File system ..." >&2
  1543. X                if [ -f /usr/bin/cat ]; then
  1544. X                    OS=sos4
  1545. X                elif [ -f /etc/nd ]; then
  1546. X                    OS=sos3
  1547. X                elif [ -f /etc/elcsd ]; then
  1548. X                    echo "    ... Ultrix - assuming U3.0 ..." >&2
  1549. X                    OS=u3_0
  1550. X                elif [ -f /hp-ux ]; then
  1551. X                    OS=hpux
  1552. X                elif [ -f /etc/ttylocal ]; then
  1553. X                    OS=xinu43
  1554. X                elif [ -f /etc/minidisk ]; then
  1555. X                    OS=acis43
  1556. X                elif [ -f /etc/toolboxdaemon ]; then
  1557. X                    OS=aux
  1558. X                elif [ -f /sbin/nfsiod ]; then
  1559. X                    OS=bsd44
  1560. X                elif [ -d /vrm ]; then
  1561. X                    OS=aix2
  1562. X                else
  1563. X                    case "`(sh arch)2>/dev/null`" in
  1564. X                    powernode) OS=utx32;;
  1565. X                    ibm032)    OS=acis43;;
  1566. X                    *)       OS=unknown;;
  1567. X                    esac
  1568. X                fi;;
  1569. Xesac
  1570. X
  1571. Xecho "    ... OS appears to be \"${OS}\"" >&2
  1572. Xecho "${OS}"
  1573. Xexit 0
  1574. END_OF_FILE
  1575. if test 2728 -ne `wc -c <'os-type'`; then
  1576.     echo shar: \"'os-type'\" unpacked with wrong size!
  1577. fi
  1578. chmod +x 'os-type'
  1579. # end of 'os-type'
  1580. fi
  1581. if test -f 'os-xinu43.h' -a "${1}" != "-c" ; then 
  1582.   echo shar: Will not clobber existing file \"'os-xinu43.h'\"
  1583. else
  1584. echo shar: Extracting \"'os-xinu43.h'\" \(2563 characters\)
  1585. sed "s/^X//" >'os-xinu43.h' <<'END_OF_FILE'
  1586. X/* $Id: os-xinu43.h,v 5.1.1.2 89/11/28 18:05:43 jsp Exp Locker: jsp $ */
  1587. X
  1588. X/*
  1589. X * mt Xinu 4.3 (MORE/bsd) definitions for Amd (automounter)
  1590. X * Should work on both Vax and HP ...
  1591. X *
  1592. X * Copyright (c) 1989 Jan-Simon Pendry
  1593. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  1594. X * Copyright (c) 1989 The Regents of the University of California.
  1595. X * All rights reserved.
  1596. X *
  1597. X * This code is derived from software contributed to Berkeley by
  1598. X * Jan-Simon Pendry at Imperial College, London.
  1599. X *
  1600. X * Redistribution and use in source and binary forms are permitted
  1601. X * provided that the above copyright notice and this paragraph are
  1602. X * duplicated in all such forms and that any documentation,
  1603. X * advertising materials, and other materials related to such
  1604. X * distribution and use acknowledge that the software was developed
  1605. X * by Imperial College of Science, Technology and Medicine, London, UK.
  1606. X * The names of the College and University may not be used to endorse
  1607. X * or promote products derived from this software without specific
  1608. X * prior written permission.
  1609. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  1610. X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  1611. X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  1612. X *
  1613. X *    %W% (Berkeley) %G%
  1614. X */
  1615. X
  1616. X/*
  1617. X * Does the compiler grok void *
  1618. X */
  1619. X#define    VOIDP
  1620. X
  1621. X/*
  1622. X * Which version of the Sun RPC library we are using
  1623. X * This is the implementation release number, not
  1624. X * the protocol revision number.
  1625. X */
  1626. X#define    RPC_4
  1627. X
  1628. X/*
  1629. X * mt Xinu have a compatibility problem
  1630. X * with getreq vs. getreqset.  On SunOS
  1631. X * getreqset takes a pointer to an fd_set,
  1632. X * whereas on MORE/bsd, getreq takes a
  1633. X * fd_set directly (cf. an integer on SunOS).
  1634. X */
  1635. X#define    svc_getreqset(p)    svc_getreq(*p)
  1636. X
  1637. X/*
  1638. X * Which version of the NFS interface are we using.
  1639. X * This is the implementation release number, not
  1640. X * the protocol revision number.
  1641. X */
  1642. X#define    NFS_4
  1643. X
  1644. X/*
  1645. X * Name of filesystem types
  1646. X */
  1647. X#define    MOUNT_TYPE_NFS    "nfs"
  1648. X#define    MOUNT_TYPE_UFS    "ufs"
  1649. X#undef MTAB_TYPE_UFS
  1650. X#define    MTAB_TYPE_UFS    "ufs"
  1651. X
  1652. X/*
  1653. X * Byte ordering
  1654. X */
  1655. X#ifndef BYTE_ORDER
  1656. X#include <machine/endian.h>
  1657. X#endif /* BYTE_ORDER */
  1658. X
  1659. X#undef ARCH_ENDIAN
  1660. X#if BYTE_ORDER == LITTLE_ENDIAN
  1661. X#define ARCH_ENDIAN "little"
  1662. X#else
  1663. X#if BYTE_ORDER == BIG_ENDIAN
  1664. X#define ARCH_ENDIAN "big"
  1665. X#else
  1666. XXXX - Probably no hope of running Amd on this machine!
  1667. X#endif /* BIG */
  1668. X#endif /* LITTLE */
  1669. X
  1670. X/*
  1671. X * Type of a file handle
  1672. X */
  1673. X#undef NFS_FH_TYPE
  1674. X#define NFS_FH_TYPE     caddr_t
  1675. X
  1676. X/*
  1677. X * Type of filesystem type
  1678. X */
  1679. X#undef MTYPE_TYPE
  1680. X#define    MTYPE_TYPE    char *
  1681. END_OF_FILE
  1682. if test 2563 -ne `wc -c <'os-xinu43.h'`; then
  1683.     echo shar: \"'os-xinu43.h'\" unpacked with wrong size!
  1684. fi
  1685. # end of 'os-xinu43.h'
  1686. fi
  1687. if test -f 'sfs_ops.c' -a "${1}" != "-c" ; then 
  1688.   echo shar: Will not clobber existing file \"'sfs_ops.c'\"
  1689. else
  1690. echo shar: Extracting \"'sfs_ops.c'\" \(2795 characters\)
  1691. sed "s/^X//" >'sfs_ops.c' <<'END_OF_FILE'
  1692. X/*
  1693. X * $Id: sfs_ops.c,v 5.1.1.1 90/01/11 17:20:21 jsp Exp Locker: jsp $
  1694. X *
  1695. X * Copyright (c) 1990 Jan-Simon Pendry
  1696. X * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  1697. X * Copyright (c) 1990 The Regents of the University of California.
  1698. X * All rights reserved.
  1699. X *
  1700. X * This code is derived from software contributed to Berkeley by
  1701. X * Jan-Simon Pendry at Imperial College, London.
  1702. X *
  1703. X * Redistribution and use in source and binary forms are permitted
  1704. X * provided that the above copyright notice and this paragraph are
  1705. X * duplicated in all such forms and that any documentation,
  1706. X * advertising materials, and other materials related to such
  1707. X * distribution and use acknowledge that the software was developed
  1708. X * by Imperial College of Science, Technology and Medicine, London, UK.
  1709. X * The names of the College and University may not be used to endorse
  1710. X * or promote products derived from this software without specific
  1711. X * prior written permission.
  1712. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  1713. X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  1714. X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  1715. X *
  1716. X *    %W% (Berkeley) %G%
  1717. X */
  1718. X
  1719. X#include "am.h"
  1720. X
  1721. X#ifdef HAS_SFS
  1722. X
  1723. X/*
  1724. X * Symbol-link file system
  1725. X */
  1726. X
  1727. X/*
  1728. X * SFS needs a link.
  1729. X */
  1730. Xstatic int sfs_match(fo)
  1731. Xam_opts *fo;
  1732. X{
  1733. X    if (!fo->opt_fs) {
  1734. X        plog(XLOG_USER, "link: no fs specified");
  1735. X        return 0;
  1736. X    }
  1737. X
  1738. X    /*
  1739. X     * Bug report (14/12/89) from Jay Plett <jay@princeton.edu>
  1740. X     * If an automount point has the same name as an existing
  1741. X     * link type mount Amd hits a race condition and either hangs
  1742. X     * or causes a symlink loop.
  1743. X     *
  1744. X     * If fs begins with a '/' change the opt_fs & opt_sublink
  1745. X     * fields so that the fs option doesn't end up pointing at
  1746. X     * an existing symlink.
  1747. X     *
  1748. X     * If sublink is nil then set sublink to fs
  1749. X     * else set sublink to fs / sublink
  1750. X     *
  1751. X     * Finally set fs to ".".
  1752. X     */
  1753. X    if (*fo->opt_fs == '/') {
  1754. X        char *fullpath;
  1755. X        char *link = fo->opt_sublink;
  1756. X        if (link) {
  1757. X            if (*link == '/')
  1758. X                fullpath = strdup(link);
  1759. X            else
  1760. X                fullpath = str3cat((char *)0, fo->opt_fs, "/", link);
  1761. X        } else {
  1762. X            fullpath = strdup(fo->opt_fs);
  1763. X        }
  1764. X
  1765. X        if (fo->opt_sublink)
  1766. X            free(fo->opt_sublink);
  1767. X        fo->opt_sublink = fullpath;
  1768. X        free(fo->opt_fs);
  1769. X        fo->opt_fs = strdup(".");
  1770. X    }
  1771. X
  1772. X    fo->fs_mtab = strealloc(fo->fs_mtab, fo->opt_fs);
  1773. X
  1774. X    return 1;
  1775. X}
  1776. X
  1777. X/*ARGUSED*/
  1778. Xstatic int sfs_mount(mp)
  1779. Xam_node *mp;
  1780. X{
  1781. X    /*
  1782. X     * Wow - this is hard to implement!
  1783. X     */
  1784. X
  1785. X    return 0;
  1786. X}
  1787. X
  1788. X/*ARGUSED*/
  1789. Xstatic int sfs_umount(mp)
  1790. Xam_node *mp;
  1791. X{
  1792. X    return 0;
  1793. X}
  1794. X
  1795. X/*
  1796. X * Ops structure
  1797. X */
  1798. Xam_ops sfs_ops = {
  1799. X    "link",
  1800. X    sfs_match,
  1801. X    0, /* sfs_init */
  1802. X    sfs_mount,
  1803. X    sfs_umount,
  1804. X    efs_lookuppn,
  1805. X    efs_readdir,
  1806. X    0, /* sfs_readlink */
  1807. X    0, /* sfs_mounted */
  1808. X    0, /* sfs_umounted */
  1809. X    find_afs_srvr,
  1810. X    FS_UBACKGROUND,
  1811. X    &afs_srvr_list
  1812. X};
  1813. X
  1814. X#endif
  1815. END_OF_FILE
  1816. if test 2795 -ne `wc -c <'sfs_ops.c'`; then
  1817.     echo shar: \"'sfs_ops.c'\" unpacked with wrong size!
  1818. fi
  1819. # end of 'sfs_ops.c'
  1820. fi
  1821. if test -f 'umount_fs.c' -a "${1}" != "-c" ; then 
  1822.   echo shar: Will not clobber existing file \"'umount_fs.c'\"
  1823. else
  1824. echo shar: Extracting \"'umount_fs.c'\" \(3093 characters\)
  1825. sed "s/^X//" >'umount_fs.c' <<'END_OF_FILE'
  1826. X/*
  1827. X * $Id: umount_fs.c,v 5.1.1.2 90/01/11 17:22:48 jsp Exp Locker: jsp $
  1828. X *
  1829. X * Copyright (c) 1990 Jan-Simon Pendry
  1830. X * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  1831. X * Copyright (c) 1990 The Regents of the University of California.
  1832. X * All rights reserved.
  1833. X *
  1834. X * This code is derived from software contributed to Berkeley by
  1835. X * Jan-Simon Pendry at Imperial College, London.
  1836. X *
  1837. X * Redistribution and use in source and binary forms are permitted
  1838. X * provided that the above copyright notice and this paragraph are
  1839. X * duplicated in all such forms and that any documentation,
  1840. X * advertising materials, and other materials related to such
  1841. X * distribution and use acknowledge that the software was developed
  1842. X * by Imperial College of Science, Technology and Medicine, London, UK.
  1843. X * The names of the College and University may not be used to endorse
  1844. X * or promote products derived from this software without specific
  1845. X * prior written permission.
  1846. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  1847. X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  1848. X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  1849. X *
  1850. X *    %W% (Berkeley) %G%
  1851. X */
  1852. X
  1853. X#include "am.h"
  1854. X
  1855. X#ifdef NEED_UMOUNT_BSD
  1856. X
  1857. X#include <sys/mount.h>        /* For MNT_NOFORCE */
  1858. X
  1859. Xint umount_fs(fs_name)
  1860. Xchar *fs_name;
  1861. X{
  1862. X    int error;
  1863. X
  1864. Xeintr:
  1865. X    error = unmount(fs_name, MNT_NOFORCE);
  1866. X    if (error < 0)
  1867. X        error = errno;
  1868. X
  1869. X    switch (error) {
  1870. X    case EINVAL:
  1871. X    case ENOTBLK:
  1872. X        plog(XLOG_WARNING, "unmount: %s is not mounted", fs_name);
  1873. X        error = 0;    /* Not really an error */
  1874. X        break;
  1875. X
  1876. X    case ENOENT:
  1877. X        plog(XLOG_ERROR, "mount point %s: %m", fs_name);
  1878. X        break;
  1879. X
  1880. X    case EINTR:
  1881. X#ifdef DEBUG
  1882. X        dlog("%s: unmount: %m", fs_name);
  1883. X#endif
  1884. X        goto eintr;
  1885. X
  1886. X#ifdef DEBUG
  1887. X    default:
  1888. X        dlog("%s: unmount: %m", fs_name);
  1889. X        break;
  1890. X#endif
  1891. X    }
  1892. X
  1893. X    return error;
  1894. X}
  1895. X
  1896. X#endif /* NEED_UMOUNT_BSD */
  1897. X
  1898. X#ifdef NEED_UMOUNT_FS
  1899. X
  1900. Xint umount_fs(fs_name)
  1901. Xchar *fs_name;
  1902. X{
  1903. X    mntlist *mlist, *mp, *mp_save = 0;
  1904. X    int error = 0;
  1905. X
  1906. X    mp = mlist = read_mtab(fs_name);
  1907. X
  1908. X    /*
  1909. X     * Search the mount table looking for
  1910. X     * the correct (ie last) matching entry
  1911. X     */
  1912. X    while (mp) {
  1913. X        if (strcmp(mp->mnt->mnt_fsname, fs_name) == 0 ||
  1914. X                strcmp(mp->mnt->mnt_dir, fs_name) == 0)
  1915. X            mp_save = mp;
  1916. X        mp = mp->mnext;
  1917. X    }
  1918. X
  1919. X    if (mp_save) {
  1920. X#ifdef DEBUG
  1921. X        dlog("Trying unmount(%s)", mp_save->mnt->mnt_dir);
  1922. X#endif
  1923. X        if (UNMOUNT_TRAP(mp_save->mnt) < 0) {
  1924. X            switch (error = errno) {
  1925. X            case EINVAL:
  1926. X            case ENOTBLK:
  1927. X                plog(XLOG_WARNING, "unmount: %s is not mounted", mp_save->mnt->mnt_dir);
  1928. X                error = 0;    /* Not really an error */
  1929. X                break;
  1930. X
  1931. X            case ENOENT:
  1932. X                plog(XLOG_ERROR, "mount point %s: %m", mp_save->mnt->mnt_dir);
  1933. X                break;
  1934. X
  1935. X            default:
  1936. X#ifdef DEBUG
  1937. X                dlog("%s: unmount: %m", mp_save->mnt->mnt_dir);
  1938. X#endif
  1939. X                break;
  1940. X            }
  1941. X        }
  1942. X
  1943. X#ifdef UPDATE_MTAB
  1944. X        if (!error) {
  1945. X            mnt_free(mp_save->mnt);
  1946. X            mp_save->mnt = 0;
  1947. X
  1948. X            rewrite_mtab(mlist);
  1949. X        }
  1950. X#endif
  1951. X    } else {
  1952. X        plog(XLOG_ERROR, "Couldn't find how to unmount %s", fs_name);
  1953. X        /*
  1954. X         * Assume it is already unmounted
  1955. X         */
  1956. X        error = 0;
  1957. X    }
  1958. X
  1959. X    free_mntlist(mlist);
  1960. X
  1961. X    return error;
  1962. X}
  1963. X
  1964. X#endif /* NEED_UMOUNT_FS */
  1965. END_OF_FILE
  1966. if test 3093 -ne `wc -c <'umount_fs.c'`; then
  1967.     echo shar: \"'umount_fs.c'\" unpacked with wrong size!
  1968. fi
  1969. # end of 'umount_fs.c'
  1970. fi
  1971. if test -f 'uwait.h' -a "${1}" != "-c" ; then 
  1972.   echo shar: Will not clobber existing file \"'uwait.h'\"
  1973. else
  1974. echo shar: Extracting \"'uwait.h'\" \(2465 characters\)
  1975. sed "s/^X//" >'uwait.h' <<'END_OF_FILE'
  1976. X/*
  1977. X * $Id: uwait.h,v 5.1 89/11/17 18:22:37 jsp Exp Locker: jsp $
  1978. X *
  1979. X * Copyright (c) 1989 Jan-Simon Pendry
  1980. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  1981. X * Copyright (c) 1989 The Regents of the University of California.
  1982. X * All rights reserved.
  1983. X *
  1984. X * This code is derived from software contributed to Berkeley by
  1985. X * Jan-Simon Pendry at Imperial College, London.
  1986. X *
  1987. X * Redistribution and use in source and binary forms are permitted
  1988. X * provided that the above copyright notice and this paragraph are
  1989. X * duplicated in all such forms and that any documentation,
  1990. X * advertising materials, and other materials related to such
  1991. X * distribution and use acknowledge that the software was developed
  1992. X * by Imperial College of Science, Technology and Medicine, London, UK.
  1993. X * The names of the College and University may not be used to endorse
  1994. X * or promote products derived from this software without specific
  1995. X * prior written permission.
  1996. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  1997. X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  1998. X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  1999. X *
  2000. X *    %W% (Berkeley) %G%
  2001. X */
  2002. X
  2003. X#if defined(mc68k) || defined(mc68000) || defined(mc68020) || defined(sparc) || defined(hp9000s300)
  2004. X#define BITS_BIGENDIAN
  2005. X#endif
  2006. X#if defined(vax) || defined(i386)
  2007. X#define BITS_LITTLENDIAN
  2008. X#endif
  2009. X#if !defined BITS_BIGENDIAN && !defined BITS_LITTLENDIAN
  2010. X #error Do not know my byte ordering
  2011. X#endif
  2012. X
  2013. X/*
  2014. X * Structure of the information in the first word returned by both
  2015. X * wait and wait3.  If w_stopval==WSTOPPED, then the second structure
  2016. X * describes the information returned, else the first.  See WUNTRACED below.
  2017. X */
  2018. Xunion wait    {
  2019. X    int    w_status;        /* used in syscall */
  2020. X    /*
  2021. X     * Terminated process status.
  2022. X     */
  2023. X    struct {
  2024. X#ifdef BITS_LITTLENDIAN
  2025. X        unsigned short    w_Termsig:7;    /* termination signal */
  2026. X        unsigned short    w_Coredump:1;    /* core dump indicator */
  2027. X        unsigned short    w_Retcode:8;    /* exit code if w_termsig==0 */
  2028. X#endif
  2029. X#ifdef BITS_BIGENDIAN
  2030. X        unsigned short    w_Fill1:16;    /* high 16 bits unused */
  2031. X        unsigned short    w_Retcode:8;    /* exit code if w_termsig==0 */
  2032. X        unsigned short    w_Coredump:1;    /* core dump indicator */
  2033. X        unsigned short    w_Termsig:7;    /* termination signal */
  2034. X#endif
  2035. X    } w_U;
  2036. X};
  2037. X#define    w_termsig    w_U.w_Termsig
  2038. X#define w_coredump    w_U.w_Coredump
  2039. X#define w_retcode    w_U.w_Retcode
  2040. X
  2041. X#define WIFSIGNALED(x)    ((x).w_termsig != 0)
  2042. X#define WIFEXITED(x)    ((x).w_termsig == 0)
  2043. END_OF_FILE
  2044. if test 2465 -ne `wc -c <'uwait.h'`; then
  2045.     echo shar: \"'uwait.h'\" unpacked with wrong size!
  2046. fi
  2047. # end of 'uwait.h'
  2048. fi
  2049. echo shar: End of archive 2 \(of 13\).
  2050. cp /dev/null ark2isdone
  2051. MISSING=""
  2052. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 ; do
  2053.     if test ! -f ark${I}isdone ; then
  2054.     MISSING="${MISSING} ${I}"
  2055.     fi
  2056. done
  2057. if test "${MISSING}" = "" ; then
  2058.     echo You have unpacked all 13 archives.
  2059.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2060. else
  2061.     echo You still need to unpack the following archives:
  2062.     echo "        " ${MISSING}
  2063. fi
  2064. ##  End of shell archive.
  2065. exit 0
  2066. exit 0 # Just in case...
  2067.